package com.mydiceplayer.impls.engine;

import java.util.List;

import android.content.Context;
import android.content.Intent;

import com.mydiceplayer.activity.MainActivity;
import com.mydiceplayer.activity.VideoPlayAndroidActivity;
import com.mydiceplayer.interfaces.engine.EnginePlayVideo;
import com.mydiceplayer.interfaces.media.PlayVideo;
import com.mydiceplayer.models.ModelVideo;

public class ImplEnginePlayVideoFFmpeg implements EnginePlayVideo {

	List<ModelVideo> videos;
	
	Context context;
	
	ImplPlayVideoDefault playVideo;
	
	public ImplEnginePlayVideoFFmpeg(Context context, List<ModelVideo> videos) {
		this.context = context;
		this.videos = videos;
		playVideo = new ImplPlayVideoDefault(videos);
	}


	@Override
	public void go2PlayVideo(PlayVideo playVideo) {
		Intent intent = new Intent(context, VideoPlayAndroidActivity.class);
		intent.putExtra(VideoPlayAndroidActivity.PLAYDATA, VideoPlayAndroidActivity.PLAYDATA_NORMAL);
		VideoPlayAndroidActivity.staticPlayVideo = playVideo;
		context.startActivity(intent);
	}


	@Override
	public void go2PlayVideo(int position) {
		playVideo.setPosition(position);
		
		Intent intent = new Intent(context, VideoPlayAndroidActivity.class);
		intent.putExtra(VideoPlayAndroidActivity.PLAYDATA, VideoPlayAndroidActivity.PLAYDATA_NORMAL);
		VideoPlayAndroidActivity.staticPlayVideo = playVideo;
		context.startActivity(intent);
		
	}


}
